/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-04-05
 * Time: 23:51
 */
public class Main {
    public static void main(String[] args) {
        // 使用常量串构造
        String s1 = "hello";
        System.out.println(s1);//hello

        // 直接newString对象
        String s2 = new String("hello");
        System.out.println(s1);//hello
        // 使用字符数组进行构造
        char[] array = {'h','e','l','l','o'};
        String s3 = new String(array);
        System.out.println(s1);//hello
    }
}
